#ifndef __environment__
#define __environment__

class environment {
    std::list<std::pair<Object, Object> > env;
    Symbol input, output;

public:
    environment();
    Port get_output() { return boost::dynamic_pointer_cast<port>(get_value(output->to_string())); }
    Port get_input() { return boost::dynamic_pointer_cast<port>(get_value(input->to_string())); }
    void set_output(Symbol sym) { output = sym; }
    void set_input(Symbol sym) { input = sym; }
    void bind(Object a, Object b);
    Object get_value(std::string s);
    Object get_value_read(std::string s);
    void bind_arg(boost::shared_ptr<environment> env, Object arg);
    void auto_remove();
};
typedef boost::shared_ptr<environment> Environment;
#endif
